//npm install mysql
const mysql = require("mysql");

//创建数据库连接
let con = mysql.createConnection({
    host: "192.168.174.166",
    user: "root",
    password: "ddd",
    database: "informationsys"
})

let userName = process.argv[2];
let userAge = process.argv[3];
let userSex = process.argv[4];
let sql = "insert into users (user_name, user_age, user_sex) values(?,?,?)";

con.query(sql, [userName, userAge, userSex], (err, results, fields) => {
    if (err) {
        console.log(err);
    }
    else {
        console.log(results)
    }
});